import yaml

class YamlOperation:

    def __init__(self,path='../../config/locator.yaml'):
        with open(path,encoding='utf-8') as fp:
            self.data=yaml.load(fp,Loader=yaml.FullLoader)    #用yaml的方式运行文件


    def get_locator(self,page,name):
        return self.data[page][name]


# yo=YamlOperation('../../data.yaml')
# print(yo.get_locator('LoginPage','username'))